package test.yzx.pproject.act1;

import android.graphics.Rect;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.widget.TextView;

public class TempActivity extends AppCompatActivity {

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

       //可以获取由桌面图标点击进入时图标的位置信息
        Rect rect = getIntent().getSourceBounds();
        if(rect != null){
            int cx = rect.centerX();
            int cy = rect.centerY();


            TextView tv = new TextView(this);
            tv.setText(rect.toString());
            setContentView(tv);
        }
    }

}
